package com.mdd.front.validate;

import com.mdd.common.validator.annotation.IDMust;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 评论参数
 * @author panweiliang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CourseCommentParam extends BaseParam {

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Integer id;

    @NotNull(message = "orderId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderId参数值不能少于0", groups = {create.class, update.class})
    private Integer orderId;

    @NotNull(message = "courseId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "courseId参数值不能少于0", groups = {create.class, update.class})
    private Long courseId;

    private Integer userId;

    @NotNull(message = "courseScore参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "courseScore参数值不能少于0", groups = {create.class, update.class})
    private Integer courseScore;

    @NotNull(message = "comment参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "comment参数不能超出255个字符", groups = {create.class, update.class})
    private String comment;

    @NotNull(message = "reply参数缺失", groups = {change.class})
    @Length(max = 200, message = "回复内容不能超出200个字符", groups = {create.class, update.class, change.class})
    private String reply;

//    @NotNull(message = "images参数缺失", groups = {create.class, update.class})
//    @NotEmpty(message = "images is not empty", groups = {create.class, update.class})
    private List<String> images;

}
